<?php
/**
 * Esta pagina es el servicio de Rosario al toque: Que hay al toque
 */
	wp_enqueue_script('OpenLayers', '/wp-content/themes/rcd/js/OpenLayers.js');
	wp_enqueue_script('RosarioAlToque', '/wp-content/themes/rcd/js/rosario-al-toque.js');
	get_header();
?>
<div id="container">
	<div id="content-que-hay-al-toque">
		<?php echo getDivCapasMapa("capas-que-hay-al-toque") ?>
		<div id="mapaPageQueHayAlToque"></div>
		<div id="boton-full-screen"><a href=javascript:ampliarMapa()><img src="/wp-content/themes/rcd/images/key-fullscreen.png"></a></div>
		<script>
			function ampliarMapa() {
				document.getElementById("mapaPageQueHayAlToque").style.width = "600px";
				document.getElementById("mapaPageQueHayAlToque").style.height = "600px";
			}
			function getCapaBySlug(slugCapa) {
				var capa;
				jQuery.each(arregloCapaMapa, function() {
					if (this['slug'] == slugCapa) {
						capa = this;
					}
				});
				return capa;
			}
			function mostrarCapa(cb, slugCapa) {
				capa = getCapaBySlug(slugCapa);
				if (cb.checked) {
					var yelp = new OpenLayers.Icon("/wp-content/themes/rcd/images/marker-mapa-rosario-al-toque.png", new OpenLayers.Size(22,22));
					var newl = new OpenLayers.Layer.GeoRSS( capa['slug'], capa['URLFeed'], {'icon':yelp, 'slug' : capa['slug']});
					map.addLayer(newl);
				} else {
					var layerABorrar = map.getLayersBy('slug', slugCapa);
					if(layerABorrar.length > 0){
						map.removeLayer(layerABorrar[0]);
					}
				}
			}
		</script>
		<script>var map = getMapaRosarioAlToque("mapaPageQueHayAlToque")</script>
		<script>
			jQuery.each(arregloCapaMapa, function() {
				if (this['URLFeed']) {
					var yelp = new OpenLayers.Icon("/wp-content/themes/rcd/images/marker-mapa-rosario-al-toque.png", new OpenLayers.Size(22,22));
					var newl = new OpenLayers.Layer.GeoRSS( this['slug'], this['URLFeed'], {'icon':yelp, 'slug' : this['slug']});
					map.addLayer(newl);
				}
			});
		</script>
	</div><!--#content-que-hay-al-toque-->
	<div><?php echo servdig_directory_shortcode("") ?></div>
</div><!-- #container -->
<?php get_footer(); ?>
